package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author liudo
 * @version 1.0
 * @project sky-take-out
 * @date 2024/2/4 14:18:26
 */
@Mapper
public interface DishFlavorMapper {
    /**
     * 插入批次
     *
     * @param flavors 口味
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 按菜式ID删除
     *
     * @param dishIds 碟形id
     */
    void deleteByDishIds(List<Long> dishIds);

    /**
     * 按菜式id选择
     *
     * @param dishId 菜id
     * @return {@link List}<{@link DishFlavor}>
     */
    @Select("select id, dish_id, name, value from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> selectByDishId(Long dishId);
}
